|
FieldsExtracted data are stored in fields in the Data Model (see The Data Model). Fields can be present on different levels: on the record level or in a detail table (see Detail tables). Fields always belong to an Extract step, as can be seen on the Step Properties pane (see Extract step properties), but they don't necessarily all contain extracted data. Adding fieldsLocation-based fieldGenerally location-based fields are added to a Data Model by extracting data; see Extracting data. Location-based fields in detail tables are created by extracting transactional data; see Extracting transactional data. Alternatively, you can add fields and detail tables directly in the Data Model pane. Right-click anywhere on the Data Model and a contextual menu will appear. Which menu items are available depends on where you've clicked. If you right-click inside the record itself, you can add a field or a detail table. A field will be added at the end with no extraction, while a detail table will be added with no fields inside. JavaScript-based fieldJavaScript-based fields are filled by a script: the script provides a value. Note that the last value attribution to a variable is the one used as the result of the expression. There is a number of ways to add a Javascript based field. Via the Steps pane
Via the Step properties pane
By changing a field's modeAlternatively you can change a location-based into a JavaScript-based field.
Property-based fieldA property-based field is filled with the value of a property. A property-based field cannot be added directly. To fill a field with the value of a property, you have to change an existing field's Mode to Properties.
Another way to add the value of a property to a field is by setting the field's Mode to JavaScript and entering the corresponding property in the Expression field, e.g. Adding fields dynamicallyOutside of the DataMapper the Data Model cannot be changed. It isn't possible to add fields to it when using the data mapping configuration in Workflow. It is however possible to add data to existing fields via Workflow; see About adding fields and data via Workflow. Editing fieldsThe list of fields that are included in the extraction, the order in which fields are extracted and the data format of each field, are all part of the Extract step's properties. These can be edited via the Step properties pane (see Extract step properties). Renaming and ordering fieldsThe order and the names of fields in the Data Model can be changed via the properties of the Extract step that they belong to.
See Order and rename fields dialog. Fields cannot have the same name, unless they are on a different level in the record.
If you intend to use the field names as metadata in a Workflow process, do not add spaces to field names, as they are not permitted in metadata field names. Setting the data typeFields store extracted data as a String by default. The data type of a field can be changed via the properties of the Extract step that the field belongs to.
Changing the type does not only set the data type inside the record. In the case of dates, numbers and currencies, it also means that the DataMapper will expect the data in the data source to be formatted in a certain way. If the actual data doesn't match the format that the DataMapper expects, it cannot interpret the date, number or currency as such. If for example a date in the data source is formatted as "yyyy-mm-dd" but the default format adds the time, the date cannot be read and the DataMapper will stop with an error. The default format for dates, numbers and currencies can be set in the user preferences (Datamapper preferences), in the data source settings (Data source settings) and per data field (in the Extract step properties, see Data Format). Setting a default valueYou may want to set a default value for a field, in case no extraction can be made. Make sure to set the data type of the field via the step properties (see above). Then right-click the field and select Default Value. Modifying extracted dataTo modify extracted data - the contents of a field - you have to write a script. The script can be entered as a Post function in a location-based field or as an Expression in a JavaScript-based field. Post functionOn the Step properties pane, under Field Definition, you can enter a script in the Post function field to be run after the extraction. (Click the Use JavaScript Editor button to open the Script
Editor dialog if you need more space.) JavaScript Expression
Alternatively you can change a field's Mode from Location to Javascript:
You will see that the JavaScript Expression field is not empty; it contains the code that was used to extract data from the location. This code can be used or deleted. The last value
attribution to a variable is the one used as the result of the
expression.
Deleting a fieldThe list of fields that are included in an extraction is one of the properties of an Extract step. To delete a field:
|
|